import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import 'swiper/css/swiper.css';
import { Button,Message,MessageBox } from 'element-ui';
import VueLazyload from 'vue-lazyload';
import loading from '@/assets/images/loading.gif';
import '@/utils/validate';


//让模拟接口生效
import '@/mock/mockServer.js';
import * as Api from '@/network';

import TypeNav from '@/components/common/TypeNav';
import SlideLoop from '@/components/common/SlideLoop';
import Pagination from '@/components/common/Pagination';
//全局注册组件
Vue.component('TypeNav',TypeNav);
Vue.component('SlideLoop',SlideLoop);
Vue.component('Pagination',Pagination);

Vue.use(Button)
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
// Vue.prototype.$confirm = MessageBox.confirm;
// Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$message = Message;


Vue.use(VueLazyload, {
  loading
})

Vue.config.productionTip = false

new Vue({
    beforeCreate() {
    Vue.prototype.$bus = this //安装事件总线
    Vue.prototype.$Api = Api
  },
  router,
  store,
  render: h => h(App)
}).$mount('#app')
